/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Configuration;
/**
 *
 * @author palugs
 */
public class EngineConfiguration 
{
    public static int[][] Request(configuration conf, int totalEngines)
    {
        int request[][] = null;
        int engineNo = 1; 
        
        switch(conf)
        {
            case AllSingleEngine:
                    if(totalEngines == 4)
                    {
                        request = new int[4][];
                        request[0] = new int[1];
                        request[1] = new int[1];
                        request[2] = new int[1];
                        request[3] = new int[1];
                    }
                    else
                    {
                        request = new int[8][];
                        request[0] = new int[1];
                        request[1] = new int[1];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        request[4] = new int[1];
                        request[5] = new int[1];
                        request[6] = new int[1];
                        request[7] = new int[1];
                    }
                    break;
            case AllDoubleEngine:
                    if(totalEngines == 4)
                    {
                        request = new int[2][];
                        request[0] = new int[2];
                        request[1] = new int[2];
                    }
                    else
                    {
                        request = new int[4][];
                        request[0] = new int[2];
                        request[1] = new int[2];
                        request[2] = new int[2];
                        request[3] = new int[2];
                    }
                break;
            case AllThreeEngine:
                if(totalEngines == 4)
                    {
                        request = new int[2][];
                        request[0] = new int[3];
                        request[1] = new int[1];
                    }
                    else
                    {
                        request = new int[3][];
                        request[0] = new int[3];
                        request[1] = new int[3];
                        request[2] = new int[2];
                    }
                break;
            case AllEngine:
                if(totalEngines == 4)
                    {
                        request = new int[1][];
                        request[0] = new int[4];
                    }
                    else
                    {
                        request = new int[1][];
                        request[0] = new int[8];
                    }
                break;
            case EightEngine_222_11:
                        request = new int[5][];
                        request[0] = new int[2];
                        request[1] = new int[2];
                        request[2] = new int[2];
                        request[3] = new int[1];
                        request[4] = new int[1];
                        break;
            case EightEngine_22_1111:
                        request = new int[6][];
                        request[0] = new int[2];
                        request[1] = new int[2];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        request[4] = new int[1];
                        request[5] = new int[1];
                        break;
            case EightEngine_2_111111:
                        request = new int[7][];
                        request[0] = new int[2];
                        request[1] = new int[1];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        request[4] = new int[1];
                        request[5] = new int[1];
                        request[6] = new int[1];
                        break;
            case EightEngine_3_11111:
                        request = new int[6][];
                        request[0] = new int[3];
                        request[1] = new int[1];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        request[4] = new int[1];
                        request[5] = new int[1];
                        break;
            case EightEngine_3_2_111:
                        request = new int[5][];
                        request[0] = new int[3];
                        request[1] = new int[2];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        request[4] = new int[1];
                        break;
            case EightEngine_33_11:
                        request = new int[4][];
                        request[0] = new int[3];
                        request[1] = new int[3];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        break;
            case EightEngine_33_2:
                        request = new int[3][];
                        request[0] = new int[3];
                        request[1] = new int[3];
                        request[2] = new int[2];
                        break;
            case EightEngine_3_22_1:
                        request = new int[4][];
                        request[0] = new int[3];
                        request[1] = new int[2];
                        request[2] = new int[2];
                        request[3] = new int[1];
                        break;
            case EightEngine_4_1111:
                        request = new int[5][];
                        request[0] = new int[4];
                        request[1] = new int[1];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        request[3] = new int[1];
                        break;
            case EightEngine_4_3_1:
                        request = new int[3][];
                        request[0] = new int[4];
                        request[1] = new int[3];
                        request[2] = new int[1];
                        break;
            case EightEngine_4_2_11:
                        request = new int[4][];
                        request[0] = new int[4];
                        request[1] = new int[2];
                        request[2] = new int[1];
                        request[3] = new int[1];
                        break;
            case EightEngine_4_22:
                        request = new int[4][];
                        request[0] = new int[4];
                        request[1] = new int[2];
                        request[2] = new int[2];
                        break;
        }
        
        for(int i = 0; i < request.length; i ++)
        {
            for(int j = 0; j < request[i].length ; j++)
            {
                request[i][j] = engineNo++;
            }
        }
                
        return request;
    }
    
}
